package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.heart.service.IWarehouseRegionService;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.WarehouseRegionMapper;
import com.ly.heart.domain.WarehouseRegionEntity;
import javax.annotation.Resource;

/**
 * 仓库区域Service业务层处理
 * 
 * @author wutao
 * @date 2024-05-27
 */
@Service
public class WarehouseRegionServiceImpl extends ServiceImpl<WarehouseRegionMapper, WarehouseRegionEntity> implements IWarehouseRegionService {

    @Resource
    private WarehouseRegionMapper warehouseRegionMapper;

    /**
     * 查询仓库区域
     * 
     * @param id 仓库区域ID
     * @return 仓库区域
     */
    @Override
    public WarehouseRegionEntity selectWarehouseRegionById(String id)
    {
        return warehouseRegionMapper.selectWarehouseRegionById(id);
    }

    /**
     * 查询仓库区域列表
     * 
     * @param warehouseRegion 仓库区域
     * @return 仓库区域
     */
    @Override
    public List<WarehouseRegionEntity> selectWarehouseRegionList(WarehouseRegionEntity warehouseRegion)
    {
        return warehouseRegionMapper.selectWarehouseRegionList(warehouseRegion);
    }

    /**
     * 新增仓库区域
     * 
     * @param warehouseRegion 仓库区域
     * @return 结果
     */
    @Override
    public int insertWarehouseRegion(WarehouseRegionEntity warehouseRegion)
    {
        warehouseRegion.setCreateTime(DateUtils.getNowDate());
        return warehouseRegionMapper.insertWarehouseRegion(warehouseRegion);
    }

    /**
     * 修改仓库区域
     * 
     * @param warehouseRegion 仓库区域
     * @return 结果
     */
    @Override
    public int updateWarehouseRegion(WarehouseRegionEntity warehouseRegion)
    {
        warehouseRegion.setUpdateTime(DateUtils.getNowDate());
        return warehouseRegionMapper.updateWarehouseRegion(warehouseRegion);
    }

    /**
     * 批量删除仓库区域
     * 
     * @param ids 需要删除的仓库区域ID
     * @return 结果
     */
    @Override
    public int deleteWarehouseRegionByIds(String[] ids)
    {
        return warehouseRegionMapper.deleteWarehouseRegionByIds(ids);
    }

    /**
     * 删除仓库区域信息
     * 
     * @param id 仓库区域ID
     * @return 结果
     */
    @Override
    public int deleteWarehouseRegionById(String id)
    {
        return warehouseRegionMapper.deleteWarehouseRegionById(id);
    }
}
